<?php
/**
 * Description of G_Apc
 *
 * @author Monk <eoe2005@gmail.com>
 */
if(function_exists('apc_store') === false){
    trigger_error('系统不支持APC缓存');
    die();
}
class G_Apc extends GC_Cache
{
    public function delete($keys)
    {
        if (is_array($keys))
        {
            foreach ($keys AS $val)
            {
                apc_delete($val);
            }
            return true;
        } else
        {
            return apc_delete($keys);
        }
    }

    public function exists($keys)
    {
        return apc_exists($keys);
    }

    public function flushAll()
    {
        return apc_clear_cache();
    }

    public function get($key)
    {
        return apc_fetch($key);
    }

    public function inc($key, $step = 1)
    {
        return apc_inc($key, $step);
    }

    public function set($key, $val, $timeout = 0)
    {
        return apc_store($key, $val,$timeout);
    }

    public function dec($key, $step = 1)
    {
        return apc_dec($key, $step);
    }

}
